package com.vspuzzle;

import android.os.Bundle;
import android.app.Activity;
import android.content.Intent;
import android.graphics.PixelFormat;
import android.graphics.Typeface;
import android.util.TypedValue;
import android.view.Menu;
import android.view.View;
import android.view.Window;
import android.widget.Button;
import android.widget.RelativeLayout;
import android.widget.TextView;

public class Menu_principale extends Activity {

	
	
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_menu_principale);
        
        Typeface type = Typeface.createFromAsset(getAssets(),"fonts/Kelly+Slab.ttf"); 
        TextView t_new_game = (TextView) findViewById(R.id.new_game);
        TextView t_scores = (TextView) findViewById(R.id.scores);
        t_new_game.setTypeface(type);
        t_new_game.setTextScaleX(2.6f);
        t_scores.setTypeface(type);
        t_scores.setTextScaleX(2.3f);
        
        final Intent intent = new Intent(this,Gioco.class);
        intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
        
        final Button btn_new_game = (Button) findViewById(R.id.new_game);
        btn_new_game.setOnClickListener(new View.OnClickListener() {
			@Override
			public void onClick(View v) {
				startActivity(intent);
			}
		});
    }


    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        // Inflate the menu; this adds items to the action bar if it is present.
        getMenuInflater().inflate(R.menu.menu_principale, menu);
        return true;
    }
    
    @Override
    public void onAttachedToWindow() {
        super.onAttachedToWindow();
        Window window = getWindow();
        window.setFormat(PixelFormat.RGBA_8888);
    }
    
}
